import {get,post,deleteRequest,putRequest} from '@/utils/request'

const Api = {
  getSettlement:'/settlement',
  uploadImgOrVoice:'/repairattach/save',
  deleteWarehouse:'/repair/part/delete2',
  saveWarehouse:'/repairaccessories/urgent/save',
  updateSettlement:'/settlement/updateJc',
  repairType:'/repair/type',
  payment:'/repair/payment',
  users:'/repair/part/questUserList',
  addRepairPeople:'/repair/part/addUserList',
  updateRowContent:'/repair/part/update2',
  addParts:'/repair/part/save',
  updateOrder:'/settlement/update'
}

export function getSettlement(param) {
  return get(Api.getSettlement,param);
}

export function uploadImgOrVoice(param) {
  return post(Api.uploadImgOrVoice,param);
}

export function deleteWarehouse(param) {
  // param:{
  //   type:1、删除整体的维修部位，2、重置维修部位，3、删除维修部为语音，4、删除单个配件或者急件
  // }
  return deleteRequest(Api.deleteWarehouse,param,true);
}

export function addWarehouse(param) {
  return post(Api.addWarehouse,param);
}

export function saveWarehouse(param) {
  return post(Api.saveWarehouse,param);
}

export function updateSettlement(param) {
  return putRequest(Api.updateSettlement,param);
}

export function repairType(param) {
  return get(Api.repairType,param);
}

export function payment(param) {
  return get(Api.payment,param);
}

export function getUsers(param) {
  return get(Api.users,param);
}

export function addRepairPeople(param) {
  return post(Api.addRepairPeople,param,true);
}

export function updateRowContent(param) {
  return post(Api.updateRowContent,param,true);
}

export function addParts(param) {
  return post(Api.addParts,param);
}

export function updateOrder(param) {
  return post(Api.updateOrder,param);
}